import java.beans.XMLDecoder;
import java.beans.XMLEncoder;
import java.io.*;

public class test 
{
	public static void main(String[] args) throws IOException 
	{
		Adres z = new Adres("Warszawa",  "Alternatywy", "4", "9");
	    Osoba k = new Osoba("Kotek", "Zygmunt", z);
	    
		XMLEncoder a = new XMLEncoder(new BufferedOutputStream(new FileOutputStream("Test.xml")));
		a.writeObject(z);
		a.writeObject(k);
		a.close();
		
		XMLDecoder b = new XMLDecoder(new BufferedInputStream(new FileInputStream("Test.xml")));
		
		Adres y = (Adres) b.readObject();
		Osoba x = (Osoba) b.readObject();
		b.close();
	}
}